<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">

	function init() {
		ShowHideRoles();
	}
	
	function ShowHideRoles() {
		var obj = document.getElementById("private");
		if(obj) {
			var val = (obj.checked == true);
			ShowHideDiv('roles_div', val, true);
		}
	}
	
	function xajax_getCategoryRoles() {
		return true;
	}	

	function checkFiles(val) {
		if(val) {
			$(".filesch").each(function(){ 
				this.checked = true;
			});
		} else {
			$(".filesch").each(function(){ 
				this.checked = false;
			});
		}
	}
	
	
	window.onload = init;
</SCRIPT>

{xajax_js}

{error_msg}

<!-- onSubmit="return Validate(this);" -->
<form action="{action_link}" method="post" enctype="multipart/form-data">
<input type="hidden" name="step" value="2">
{hidden_fields}

<table border=0 width="100%" cellpadding="5" cellspacing="1">
<tr>
	<td colspan="2" class="tdTitle"><b>{bulk_add_msg}:</td>
</tr>

<tr class="trlighter">
	<td class="tdFormCaption" nowrap>{directory_msg}: {required_sign}</td>
	<td>
		<input type="text" name="directory" id="directory" value="{directory}" class="longText" style="width: 500px;">
		<input type="button" value="{get_file_list_msg}" onclick="xajax_getFileList(document.getElementById('directory').value)">
	</td>
</tr>

<tr class="trlighter" valign="top">
	<td class="tdFormCaption" nowrap>{files_msg}:</td>
	<td><div id="file_root"></div></td>
</tr>

<tr class="trlighter">
	<td class="tdFormCaption" nowrap valign="top">{category_msg}: {required_sign}</td>
	<td>
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td>
				<div style="padding-bottom: 4px;">{category_msg}:</div>
				<select name="category[]" id="category" size="6" style="width: 300px;" 
					onChange="xajax_getCategoryRoles(this.value);">
				{category_select}
				</select>
			</td>
			<td style="padding: 15px;"></td>
			<td valign="top">
				<div style="padding-bottom: 4px;">{mirror_in_category_msg}:</div>
				<select name="category_mirror[]" id="category_mirror" size="6" multiple style="width: 300px;">
				{category_mirror_select}
				</select>				
			</td>
		</tr>
		</table>
	</td>
</tr>

<tr class="trlighter">
	<td class="tdFormCaption" nowrap>{title_msg}:</td>
	<td><input type="text" name="title" value="{title}" class="longText" style="width: 625px;"></td>
</tr>

<tr class="trlighter" valign="top">
	<td class="tdFormCaption" nowrap>{description_msg}:</td>
	<td><textarea cols="100" rows="5" name="description">{description}</textarea>
</tr>

<tmpl:private>
<tr class="trlighter">
	<td class="tdFormCaption" nowrap valign="top">{private_msg}:</td>
	<td>
		<input type="checkbox" name="private" id="private" value="1" {private_options} onClick="ShowHideRoles()"> {yes_msg}
		<span style="margin-left: 10px;" id="category_info_1">{category_info}</span>
		
		<div id="roles_div" style="display: none">
			<div style="padding: 8px 0px;">{role_access_msg}:&nbsp;&nbsp;
				<a href="javascript:selectAll(true, 'member_role'); void(0);">{all_msg}</a> |
				<a href="javascript:selectAll(false, 'member_role'); void(0);">{none_msg}</a>
			</div>
			
			<select name="member_role[]" id="member_role" size="4" multiple style="WIDTH: 250px">
				{member_role_select}
			</select>
		</div>
		
	</td>
</tr>
</tmpl:private>

<tr class="trlighter">
	<td class="tdFormCaption" nowrap>{status_msg}:</td>
	<td>{status_checkbox}</td>
</tr>

<tr> 
	<td></td>
	<td><div><br></div>
		<input type="submit" name="submit" value="{add_files_msg}" class="button">
		<input type="button" value="{back_msg}" onClick="location.href='{cancel_link}'" class="button">
	</td>
</tr>
</table>
</form>
